package com.epro.dx.task;

import android.os.AsyncTask;

import com.epro.dx.listenner.CustomAsyncTaskListener;
import com.epro.dx.util.ActivityUtil;
import com.weipu.common.facade.factory.ProviderFactory;
import com.weipu.common.facade.model.PushSettingsModel;

/**
 * 获取用户设置的物流订阅功能的设置
 * @author Zenglw
 * @version [1.0, 2017.6.27]
 */
public class GetTrackConfigTask extends AsyncTask<Void, Void, PushSettingsModel.DataBean> {

    private CustomAsyncTaskListener mListener;

    public GetTrackConfigTask(CustomAsyncTaskListener listenner) {
        this.mListener = listenner;
    }

    @Override
    protected PushSettingsModel.DataBean doInBackground(Void... voids) {
        return ProviderFactory.createTrackService()
                .readTrackConfig(ActivityUtil.getCustomerID(), ActivityUtil.getCustomerToken());
    }

    @Override
    protected void onPostExecute(PushSettingsModel.DataBean result) {
        super.onPostExecute(result);
        if (mListener != null) {
            mListener.onPostExecute(result);
        }
    }

}
